<template>
  <div >
    <back/>
    <nav class="name" v-text="nickname"></nav>
    <private-msg key="private" />
    <private-input />
  </div>
</template>

<script>
import Back from '../../../../components/Back/Back.vue';
import PrivateInput from './PrivateInput.vue';
import PrivateMsg from './PrivateMsg.vue';

export default {
  components: {Back, PrivateMsg, PrivateInput  },
  name: 'PrivateChat',
  data () {
    return {
    }
  },
  mounted(){
    //判断是否已经获取该好友的聊天记录
    // if(this.$store.state[`${this.receiveId}`].length == 0){
    //   this.getPrivatemsg()
    // }
    //获取与该好友的聊天记录
  },
  activated(){
    
  },
  computed:{
   _id() {//用户自己id
      return this.$store.getters.user._id || JSON.parse(localStorage.getItem('userInfo'))._id || '';
  },
  receiveId(){//接收者id
    return this.$route.params.uid || ''
  },
  nickname(){
    return this.$route.params.nickname || ''
  },
  },
  methods:{
    
}
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
nav {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  background-color: aqua;
  text-align: center;
  height: 48px;
  line-height: 44px;
  z-index: 10;
}
</style>